package com.aurora.oa.work.view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ListView;

import com.aurora.oa.R;
import com.aurora.oa.activity.BaseActivity;
import com.aurora.oa.listener.OnRequestLogListDataListener;
import com.aurora.oa.model.RequestHttpModel;
import com.aurora.oa.model.RequestHttpModelImpl;
import com.aurora.oa.utils.ToastUtil;
import com.aurora.oa.work.adapter.WorkLogAdapter;
import com.aurora.oa.work.bean.WorkLogDataBean;

import java.util.List;

import freemarker.template.utility.NormalizeNewlines;

/**
 * Created by Administrator on 2017/4/13 0013.
 */
public class WorkLogMyReceiveActivity extends BaseActivity{

    ListView lv_myreceive_log;
    RequestHttpModel model = new RequestHttpModelImpl();
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setMyContentView(R.layout.activity_work_log_myreceive);
        initTitlebar(true,"日志",true);
        initView();
        initData();
    }

    private void initData() {
        model.getMyReceiveWorkLog(new OnRequestLogListDataListener() {
            @Override
            public void onRequestLogListDataSuccess(List<WorkLogDataBean> logDataList) {
                lv_myreceive_log.setAdapter(new WorkLogAdapter(WorkLogMyReceiveActivity.this,logDataList));
            }

            @Override
            public void onRequestLogListDataFail(String message) {
                ToastUtil.show(WorkLogMyReceiveActivity.this,message);
            }
        });
    }

    private void initView() {
        lv_myreceive_log = (ListView) findViewById(R.id.lv_myreceive_log);
    }
}
